using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIComposite_DockpanelArea_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIComposite.DockpanelArea);
            args = new Type[]{typeof(huqiang.UIComposite.DockPanelLine)};
            method = type.GetMethod("SetLeftLine", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, SetLeftLine_0);
            args = new Type[]{typeof(huqiang.UIComposite.DockPanelLine)};
            method = type.GetMethod("SetRightLine", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, SetRightLine_1);
            args = new Type[]{typeof(huqiang.UIComposite.DockPanelLine)};
            method = type.GetMethod("SetTopLine", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, SetTopLine_2);
            args = new Type[]{typeof(huqiang.UIComposite.DockPanelLine)};
            method = type.GetMethod("SetDownLine", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, SetDownLine_3);
            args = new Type[]{};
            method = type.GetMethod("SizeChanged", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, SizeChanged_4);
            args = new Type[]{typeof(huqiang.UIComposite.DockpanelArea.Dock), typeof(System.Single), typeof(System.String)};
            method = type.GetMethod("AddAreaR", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, AddAreaR_5);
            args = new Type[]{typeof(huqiang.UIComposite.DockpanelArea.Dock), typeof(System.Single), typeof(System.String)};
            method = type.GetMethod("AddArea", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, AddArea_6);
            args = new Type[]{};
            method = type.GetMethod("Dispose", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Dispose_7);
            args = new Type[]{typeof(huqiang.Data.FakeStructArray), typeof(System.Int32)};
            method = type.GetMethod("SaveToDataBuffer", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, SaveToDataBuffer_8);
            args = new Type[]{typeof(huqiang.Data.FakeStructArray), typeof(System.Int32)};
            method = type.GetMethod("LoadFromBuffer", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, LoadFromBuffer_9);

            field = type.GetField("Name", flag);
            app.RegisterCLRFieldGetter(field, get_Name_0);
            app.RegisterCLRFieldSetter(field, set_Name_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_Name_0, AssignFromStack_Name_0);
            field = type.GetField("model", flag);
            app.RegisterCLRFieldGetter(field, get_model_1);
            app.RegisterCLRFieldSetter(field, set_model_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_model_1, AssignFromStack_model_1);
            field = type.GetField("layout", flag);
            app.RegisterCLRFieldGetter(field, get_layout_2);
            app.RegisterCLRFieldSetter(field, set_layout_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_layout_2, AssignFromStack_layout_2);


            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIComposite.DockpanelArea[s]);

            args = new Type[]{typeof(huqiang.UIComposite.DockPanel)};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* SetLeftLine_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.DockPanelLine @line = (huqiang.UIComposite.DockPanelLine)typeof(huqiang.UIComposite.DockPanelLine).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.DockpanelArea instance_of_this_method = (huqiang.UIComposite.DockpanelArea)typeof(huqiang.UIComposite.DockpanelArea).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetLeftLine(@line);

            return __ret;
        }

        static StackObject* SetRightLine_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.DockPanelLine @line = (huqiang.UIComposite.DockPanelLine)typeof(huqiang.UIComposite.DockPanelLine).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.DockpanelArea instance_of_this_method = (huqiang.UIComposite.DockpanelArea)typeof(huqiang.UIComposite.DockpanelArea).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetRightLine(@line);

            return __ret;
        }

        static StackObject* SetTopLine_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.DockPanelLine @line = (huqiang.UIComposite.DockPanelLine)typeof(huqiang.UIComposite.DockPanelLine).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.DockpanelArea instance_of_this_method = (huqiang.UIComposite.DockpanelArea)typeof(huqiang.UIComposite.DockpanelArea).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetTopLine(@line);

            return __ret;
        }

        static StackObject* SetDownLine_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.DockPanelLine @line = (huqiang.UIComposite.DockPanelLine)typeof(huqiang.UIComposite.DockPanelLine).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.DockpanelArea instance_of_this_method = (huqiang.UIComposite.DockpanelArea)typeof(huqiang.UIComposite.DockpanelArea).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetDownLine(@line);

            return __ret;
        }

        static StackObject* SizeChanged_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.DockpanelArea instance_of_this_method = (huqiang.UIComposite.DockpanelArea)typeof(huqiang.UIComposite.DockpanelArea).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SizeChanged();

            return __ret;
        }

        static StackObject* AddAreaR_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.String @name = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Single @r = *(float*)&ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.UIComposite.DockpanelArea.Dock @dock = (huqiang.UIComposite.DockpanelArea.Dock)typeof(huqiang.UIComposite.DockpanelArea.Dock).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)20);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            huqiang.UIComposite.DockpanelArea instance_of_this_method = (huqiang.UIComposite.DockpanelArea)typeof(huqiang.UIComposite.DockpanelArea).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.AddAreaR(@dock, @r, @name);

            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* AddArea_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.String @name = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Single @w = *(float*)&ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.UIComposite.DockpanelArea.Dock @dock = (huqiang.UIComposite.DockpanelArea.Dock)typeof(huqiang.UIComposite.DockpanelArea.Dock).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)20);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            huqiang.UIComposite.DockpanelArea instance_of_this_method = (huqiang.UIComposite.DockpanelArea)typeof(huqiang.UIComposite.DockpanelArea).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.AddArea(@dock, @w, @name);

            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* Dispose_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.DockpanelArea instance_of_this_method = (huqiang.UIComposite.DockpanelArea)typeof(huqiang.UIComposite.DockpanelArea).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Dispose();

            return __ret;
        }

        static StackObject* SaveToDataBuffer_8(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @index = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Data.FakeStructArray @fake = (huqiang.Data.FakeStructArray)typeof(huqiang.Data.FakeStructArray).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.UIComposite.DockpanelArea instance_of_this_method = (huqiang.UIComposite.DockpanelArea)typeof(huqiang.UIComposite.DockpanelArea).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SaveToDataBuffer(@fake, @index);

            return __ret;
        }

        static StackObject* LoadFromBuffer_9(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @index = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Data.FakeStructArray @fake = (huqiang.Data.FakeStructArray)typeof(huqiang.Data.FakeStructArray).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.UIComposite.DockpanelArea instance_of_this_method = (huqiang.UIComposite.DockpanelArea)typeof(huqiang.UIComposite.DockpanelArea).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.LoadFromBuffer(@fake, @index);

            return __ret;
        }


        static object get_Name_0(ref object o)
        {
            return ((huqiang.UIComposite.DockpanelArea)o).Name;
        }

        static StackObject* CopyToStack_Name_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.DockpanelArea)o).Name;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Name_0(ref object o, object v)
        {
            ((huqiang.UIComposite.DockpanelArea)o).Name = (System.String)v;
        }

        static StackObject* AssignFromStack_Name_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.String @Name = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.DockpanelArea)o).Name = @Name;
            return ptr_of_this_method;
        }

        static object get_model_1(ref object o)
        {
            return ((huqiang.UIComposite.DockpanelArea)o).model;
        }

        static StackObject* CopyToStack_model_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.DockpanelArea)o).model;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_model_1(ref object o, object v)
        {
            ((huqiang.UIComposite.DockpanelArea)o).model = (huqiang.Core.HGUI.UIElement)v;
        }

        static StackObject* AssignFromStack_model_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Core.HGUI.UIElement @model = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.DockpanelArea)o).model = @model;
            return ptr_of_this_method;
        }

        static object get_layout_2(ref object o)
        {
            return ((huqiang.UIComposite.DockpanelArea)o).layout;
        }

        static StackObject* CopyToStack_layout_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.DockpanelArea)o).layout;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_layout_2(ref object o, object v)
        {
            ((huqiang.UIComposite.DockpanelArea)o).layout = (huqiang.UIComposite.DockPanel)v;
        }

        static StackObject* AssignFromStack_layout_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.UIComposite.DockPanel @layout = (huqiang.UIComposite.DockPanel)typeof(huqiang.UIComposite.DockPanel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.DockpanelArea)o).layout = @layout;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.DockPanel @lay = (huqiang.UIComposite.DockPanel)typeof(huqiang.UIComposite.DockPanel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            var result_of_this_method = new huqiang.UIComposite.DockpanelArea(@lay);

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
